package com.leshua.channel.mpos.common.exception;

import com.leshua.channel.mpos.common.enums.ErrorEnum;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Devlin
 * @date 2019/12/4
 */
@Data
@NoArgsConstructor
public class BusinessException extends RuntimeException {
    private String code ;
    private String message ;

    public BusinessException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public BusinessException(ErrorEnum errorEnum){
        this.code = errorEnum.getCode();
        this.message = errorEnum.getMessage();
    }
}
